﻿using System;
using System.Web.Mvc;

namespace BoneSystem.Extensions.Annotations.InputTypeAnnotations
{
    public class DateAttribute : InputAttribute
    {
        public DateAttribute()
        {
            
        }
        public string MinDate { get; set; }
        public string MaxDate { get; set; }
        public string DateFormat { get; set; }
        public string DateMask { get; set; }

        public override TagBuilder TagBuilder()
        {
            var tag = base.TagBuilder();
            tag.Attributes["type"] = "date";
            tag.Attributes["min"] = MinDate;
            tag.Attributes["max"] = MaxDate;
            tag.Attributes["data-mask"] = "00/00/0000";
            tag.Attributes["data-mask-reverse"] = "true";
            tag.Attributes["data-mask-maxlength"] = "false";
            return tag;
        }
    }
}
